/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package LogicadeNegocio;

import CapadeDatos.DaoVerModulos;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import modelo.beanmodulo;

/**
 *
 * @author hans
 */
public class combomodulo {
    JComboBox jcombo;
    ArrayList lista;
    beanmodulo[] detalles;
    JTextField textbox;
    public combomodulo(JComboBox combo){
        jcombo = combo;
    }

    public void cargarmodulo() throws Exception{
     // Llamamos al metodo datos modulo que nos devuelve el ArrayList
      lista = (ArrayList) DaoVerModulos.listaItem1();
      detalles = new beanmodulo[lista.size()];
      Iterator itr = lista.iterator();
      int j=0;
      jcombo.removeAllItems();
      while (itr.hasNext()) {
          detalles[j] =  (beanmodulo) itr.next();
          jcombo.addItem(detalles[j].getNombremodulo());        
          j++;
      }

    }
    public  beanmodulo[] semestre(){
      return detalles;
    }
}
